﻿using RegexBuilder.Attributes;
using System;
using System.Text;

namespace RegexBuilder.Enums
{
    /// <summary>
    /// 
    /// </summary>
    [Flags]
    public enum CharSetEnum : ulong
    {
        /// <summary>
        /// 全部匹配
        /// </summary>
        [RegexString(@".")]
        All = UInt32.MaxValue,
        /// <summary>
        /// 数字   0-9
        /// </summary>
        [RegexString(@"\d")]
        Number = 1 << 0,
        /// <summary>
        /// 小写字母 a-z
        /// </summary>
        [RegexString(@"a-z")]
        Lowercase = 1 << 1,
        /// <summary>
        /// 大写字母 A-Z
        /// </summary>
        [RegexString(@"A-Z")]
        Uppercase = 1 << 2,
        /// <summary>
        /// 所有空白
        /// </summary>
        [RegexString(@"\s")]
        SpaceAndTab = 1 << 3,
        /// <summary>
        /// 字符
        /// </summary>
        [RegexString(@"\w")]
        World = 1 << 4,
        /// <summary>
        /// 空格
        /// </summary>
        [RegexString(@" ")]
        Space = 1 << 5,
        /// <summary>
        /// Ascii字符
        /// </summary>
        [RegexString(@"\u0000-\u00FF")]
        Ascii = 1 << 6,
        /// <summary>
        /// 中文
        /// </summary>
        [RegexString(@"\u4e00-\u9fa5")]
        Chinese = 1 << 8,
        /// <summary>
        /// 双字节字符
        /// </summary>
        [RegexString(@"\u0100-\uFFFF")]
        TwoCharCode = 1<<9,



        #region 快速组合段
        /// <summary>
        /// 英文字母
        /// </summary>
        EnglishLetter = Lowercase | Uppercase,
        NotEnglishLetter = EnglishLetter<<32,
        #endregion




        //高32位标记只于勇速查
        /// <summary>
        /// 非小写字母 a-z
        /// </summary>
        [RegexString(@"^a-z")]
        NotLowercase = Lowercase << 32,
        /// <summary>
        /// 非大写字母 A-Z
        /// </summary>
        [RegexString(@"^A-Z")]
        NotUppercase = Uppercase<<32,
        /// <summary>
        /// 非空白
        /// </summary>
        [RegexString(@"\S")]
        NotSpaceAndTab = SpaceAndTab<<32,
        /// <summary>
        /// 非字符
        /// </summary>
        [RegexString(@"\W")]
        NotWorld = World<<32,
        /// <summary>
        /// 非数字
        /// </summary>
        [RegexString(@"\D")]
        NotNumber = Number<<32,

    }
}
